<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 日期</title>
</head>
<body>
<h2>创建 Date 对象——new Date()</h2>
<p>new Date() 用当前日期和时间创建新的日期对象：</p>

<p id="demo"></p>

<script>
  var d = new Date();
  document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

<!--
输出例子：Wed Sep 06 2023 21:14:55 GMT+0800 (China Standard Time)
-->